package org.noahsark.nsmessenger.model;

import java.io.Serializable;

@SuppressWarnings("serial")
public abstract class Message implements Serializable {

	private MessageBehavior mBehavior;
	private byte[] mMsg;
	private Context mContext;

	public Message setMsg(byte[] msg) {
		mMsg = msg;

		return this;
	}

	public byte[] getMsg() {
		return mMsg;
	}

	public Message setBehavior(MessageBehavior behavior) {
		mBehavior = behavior;

		return this;
	}

	public MessageBehavior getBehavior() {
		return mBehavior;
	}

	public Message setContext(Context context) {
		mContext = context;

		return this;
	}

	public Context getContext() {
		return mContext;
	}

	public void perform() {
		mBehavior.perform(mContext, mMsg);
	}

}
